var XML = {
	getValueForTag: function(obj, tagName) {
		var item = obj.getElementsByTagName(tagName)[0];
		if (item)
			return item.textContent ? item.textContent : item.text;
		else
			return null;
	},
	getElementsArrayByTagName: function(obj, tagName) {
		var elements = obj.getElementsByTagName(tagName);
		if (elements && elements.length > 0)
			return XML.convertToArray(elements);
		else
			return null;
	},
	getElementsByTagNameNS: function(obj, namespace) {
		return obj.getElementsByTagNameNS ? obj.getElementsByTagNameNS(obj.lookupNamespaceURI(namespace), '*') : obj.getElementsByTagName(namespace+':*');
	},
	convertToArray: function(nonArrayThing) {
		return new Array(nonArrayThing).flatten();
	}
};